/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.tnmk.worktime.service.model.xmladapter;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.tnmk.worktime.service.dao.entry.SpendEntry;

/**
 *
 * @author Administrator
 * @param <T>
 */
@XmlRootElement
public class ListWrapper<T> {

  private final List<T> items;

  public ListWrapper() {
    items = new ArrayList<>();
  }

  public ListWrapper(List<T> items) {
    this.items = items;
  }

  @XmlAnyElement(lax = true)
  public List<T> getItems() {
    return items;
  }

  public boolean add(T e) {
    return items.add(e);
  }

  public void remove(T e) {
    items.remove(e);
  }
  public void removeAt(int index){
    items.remove(index);
  }
}
